package com.ly.heart.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ly.common.utils.DateUtils;
import com.ly.heart.mapper.SupplierOrganizationMapper;
import com.ly.heart.service.ISupplierOrganizationService;
import org.springframework.stereotype.Service;
import com.ly.heart.domain.SupplierOrganizationEntity;

import javax.annotation.Resource;

/**
 * 供应商组织信息Service业务层处理
 *
 * @author cxl
 * @date 2024-06-16
 */
@Service
public class SupplierOrganizationServiceImpl extends ServiceImpl<SupplierOrganizationMapper,SupplierOrganizationEntity> implements ISupplierOrganizationService {

    @Resource
    private SupplierOrganizationMapper supplierOrganizationMapper;

    /**
     * 查询供应商组织信息
     *
     * @param id 供应商组织信息ID
     * @return 供应商组织信息
     */
    @Override
    public SupplierOrganizationEntity selectSupplierOrganizationEntityById(String id)
    {
        return supplierOrganizationMapper.selectSupplierOrganizationEntityById(id);
    }

    /**
     * 查询供应商组织信息列表
     *
     * @param supplierOrganizationEntity 供应商组织信息
     * @return 供应商组织信息
     */
    @Override
    public List<SupplierOrganizationEntity> selectSupplierOrganizationEntityList(SupplierOrganizationEntity supplierOrganizationEntity)
    {
        return supplierOrganizationMapper.selectSupplierOrganizationEntityList(supplierOrganizationEntity);
    }

    /**
     * 新增供应商组织信息
     *
     * @param supplierOrganizationEntity 供应商组织信息
     * @return 结果
     */
    @Override
    public int insertSupplierOrganizationEntity(SupplierOrganizationEntity supplierOrganizationEntity)
    {
        supplierOrganizationEntity.setCreateTime(DateUtils.getNowDate());
        return supplierOrganizationMapper.insertSupplierOrganizationEntity(supplierOrganizationEntity);
    }

    /**
     * 修改供应商组织信息
     *
     * @param supplierOrganizationEntity 供应商组织信息
     * @return 结果
     */
    @Override
    public int updateSupplierOrganizationEntity(SupplierOrganizationEntity supplierOrganizationEntity)
    {
        return supplierOrganizationMapper.updateSupplierOrganizationEntity(supplierOrganizationEntity);
    }

    /**
     * 批量删除供应商组织信息
     *
     * @param ids 需要删除的供应商组织信息ID
     * @return 结果
     */
    @Override
    public int deleteSupplierOrganizationEntityByIds(String[] ids)
    {
        return supplierOrganizationMapper.deleteSupplierOrganizationEntityByIds(ids);
    }

    /**
     * 删除供应商组织信息信息
     *
     * @param id 供应商组织信息ID
     * @return 结果
     */
    @Override
    public int deleteSupplierOrganizationEntityById(String id)
    {
        return supplierOrganizationMapper.deleteSupplierOrganizationEntityById(id);
    }
}
